IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[PPS_HP_DiaChi_All]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[PPS_HP_DiaChi_All]
Go

Create Proc PPS_HP_DiaChi_All
As
Begin
	Select Distinct DiaChi
	from
	(
		Select Distinct  DiaChi
		from HP_Phieu
		where IsNull(DiaChi,'')<>''
		
		Union All
		Select Distinct  DiaChi
		from HP_BenhNhan
		where IsNull(DiaChi,'')<>''
	)t
	Order By DiaChi asc
End